package model

import "fmt"

type person struct {
	Name  string
	age   int
	wages float64
}

func NewPerson(name string) *person {
	return &person{
		Name: name,
	}
}

func (p *person) SetAge(age int) bool {
	if age < 0 || age > 150 {
		fmt.Println("年龄范围不正确")
		return false
	}
	p.age = age
	return true
}
func (p *person) GetAge() int {
	return p.age
}
func (p *person) SetWages(wages float64) bool {
	if wages < 3000 || wages > 30000 {
		fmt.Println("工资范围不正确")
		return false
	}
	p.wages = wages
	return true
}
func (p *person) GetWages() float64 {
	return p.wages
}
